package com.ruoyi.flow.auth.security.sso;

import com.ruoyi.flow.auth.security.sso.SsoUsernamePassword;
import com.ruoyi.flow.auth.security.sso.SsoUsernamePasswordProvider;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author wtian
 * @version 1.0
 * @since 2018/9/12 16:52
 */
public class TestSsoUsernamePasswordProvider implements SsoUsernamePasswordProvider {
    @Override
    public com.ruoyi.flow.auth.security.sso.SsoUsernamePassword getUsernameAndPassword(Map<String, String[]> parameters) {
        SsoUsernamePassword ssoUsernamePassword = new SsoUsernamePassword();
        ssoUsernamePassword.setUsername("admin");
        ssoUsernamePassword.setPassword("123456");
        return ssoUsernamePassword;
    }

    @Override
    public boolean matchRequest(HttpServletRequest request) {
        return request.getParameter("token") != null;
    }
}
